import QtQuick
import QtQuick.Controls

Item {
    width: 400
    height: 400

    Image {
        id: image
        source: "qrc:/images/deepseek-logo.png"
        width: 200
        height: 200
        anchors.centerIn: parent

        transform: Translate {
            id: translateTransform
            x: 0
            y: 0
        }
    }

    // 使用鼠标拖拽实现平移
    MouseArea {
        anchors.fill: parent
        property point lastPos

        onPressed: lastPos = Qt.point(mouse.x, mouse.y)
        onPositionChanged: {
            translateTransform.x += mouse.x - lastPos.x
            translateTransform.y += mouse.y - lastPos.y
            lastPos = Qt.point(mouse.x, mouse.y)
        }
    }
}
